<html>
<head><meta charset="utf-8"><title>When to re-run ThinLTO, for PR #71267 · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/When.20to.20re-run.20ThinLTO.2C.20for.20PR.20.2371267.html">When to re-run ThinLTO, for PR #71267</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="194679613"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/When%20to%20re-run%20ThinLTO%2C%20for%20PR%20%2371267/near/194679613" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/When.20to.20re-run.20ThinLTO.2C.20for.20PR.20.2371267.html#194679613">(Apr 20 2020 at 14:08)</a>:</h4>
<p>I cannot believe that its taken me this long to read <a href="http://blog.llvm.org/2016/06/thinlto-scalable-and-incremental-lto.html" title="http://blog.llvm.org/2016/06/thinlto-scalable-and-incremental-lto.html">LLVM's ThinLTO post</a> in the necessary amount of detail to find our bugs</p>



<a name="194679718"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/When%20to%20re-run%20ThinLTO%2C%20for%20PR%20%2371267/near/194679718" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/When.20to.20re-run.20ThinLTO.2C.20for.20PR.20.2371267.html#194679718">(Apr 20 2020 at 14:09)</a>:</h4>
<p>They literally write you need to redo LTO when any of the following hold:</p>
<blockquote>
<ol>
<li>The corresponding (primary) module’s bitcode changed </li>
<li>The list of imports into or exports from the module changed </li>
<li>The bitcode for any module being imported from has changed </li>
<li>Any global analysis result affecting either the primary module or anything it imports has changed.</li>
</ol>
</blockquote>



<a name="194679823"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/When%20to%20re-run%20ThinLTO%2C%20for%20PR%20%2371267/near/194679823" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/When.20to.20re-run.20ThinLTO.2C.20for.20PR.20.2371267.html#194679823">(Apr 20 2020 at 14:10)</a>:</h4>
<p>We were using 3 since the beginning. I added the <em>first part</em> of 2.</p>



<a name="194679835"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/When%20to%20re-run%20ThinLTO%2C%20for%20PR%20%2371267/near/194679835" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/When.20to.20re-run.20ThinLTO.2C.20for.20PR.20.2371267.html#194679835">(Apr 20 2020 at 14:10)</a>:</h4>
<p>and then more recently I added the rest of 2.</p>



<a name="194681235"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/When%20to%20re-run%20ThinLTO%2C%20for%20PR%20%2371267/near/194681235" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/When.20to.20re-run.20ThinLTO.2C.20for.20PR.20.2371267.html#194681235">(Apr 20 2020 at 14:21)</a>:</h4>
<p><span class="user-mention" data-user-id="116083">@pnkfelix</span> it might make sense to ping some of the llvm folks as well -- some of those may have changed I guess?</p>
<p>We'd probably also want clarification on whether that's necessary for correctness or just performance (since for incremental we mostly care about correctness). e.g. if we export too much that probably doesn't matter much in practice, for Rust code, anyway?</p>



<a name="194682754"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/When%20to%20re-run%20ThinLTO%2C%20for%20PR%20%2371267/near/194682754" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/When.20to.20re-run.20ThinLTO.2C.20for.20PR.20.2371267.html#194682754">(Apr 20 2020 at 14:31)</a>:</h4>
<p>I suppose its possible (that things have changed since then)</p>



<a name="194682780"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/When%20to%20re-run%20ThinLTO%2C%20for%20PR%20%2371267/near/194682780" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/When.20to.20re-run.20ThinLTO.2C.20for.20PR.20.2371267.html#194682780">(Apr 20 2020 at 14:31)</a>:</h4>
<p>it seems like its enough to justify landing the patch in the meantime, though</p>



<a name="194683358"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/When%20to%20re-run%20ThinLTO%2C%20for%20PR%20%2371267/near/194683358" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/When.20to.20re-run.20ThinLTO.2C.20for.20PR.20.2371267.html#194683358">(Apr 20 2020 at 14:34)</a>:</h4>
<p><span class="user-mention" data-user-id="116122">@simulacrum</span> what do you think is best way to informally reach out to LLVM folks about this? Or do you "just" mean the LLVM experts within the Rust community, e.g. wg-llvm ?</p>



<a name="194683417"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/When%20to%20re-run%20ThinLTO%2C%20for%20PR%20%2371267/near/194683417" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/When.20to.20re-run.20ThinLTO.2C.20for.20PR.20.2371267.html#194683417">(Apr 20 2020 at 14:35)</a>:</h4>
<p>Yeah I meant just our folks</p>



<a name="194683437"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/When%20to%20re-run%20ThinLTO%2C%20for%20PR%20%2371267/near/194683437" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/When.20to.20re-run.20ThinLTO.2C.20for.20PR.20.2371267.html#194683437">(Apr 20 2020 at 14:35)</a>:</h4>
<p>I agree it's enough to justify the patch</p>



<a name="194683844"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/When%20to%20re-run%20ThinLTO%2C%20for%20PR%20%2371267/near/194683844" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/When.20to.20re-run.20ThinLTO.2C.20for.20PR.20.2371267.html#194683844">(Apr 20 2020 at 14:38)</a>:</h4>
<p>cc <span class="user-group-mention" data-user-group-id="1176">@WG-llvm</span> , any thoughts on the above reasoning?</p>



<a name="194685031"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/When%20to%20re-run%20ThinLTO%2C%20for%20PR%20%2371267/near/194685031" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/When.20to.20re-run.20ThinLTO.2C.20for.20PR.20.2371267.html#194685031">(Apr 20 2020 at 14:46)</a>:</h4>
<p>I am fuzzy on the terminology used here. Does "(d) the content of any of the modules it exports to has changed" in <a href="https://github.com/rust-lang/rust/pull/71267#issuecomment-616581678" title="https://github.com/rust-lang/rust/pull/71267#issuecomment-616581678">https://github.com/rust-lang/rust/pull/71267#issuecomment-616581678</a> mean: in the case where CGU 1 and CGU 2 pull in data from the summary/index generated from CGU 3 (e.g., making some small function available for inlining), the question is whether we need to re-do CGU 3 when either CGU 1 or CGU 2 changes?</p>



<a name="194685706"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/When%20to%20re-run%20ThinLTO%2C%20for%20PR%20%2371267/near/194685706" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/When.20to.20re-run.20ThinLTO.2C.20for.20PR.20.2371267.html#194685706">(Apr 20 2020 at 14:51)</a>:</h4>
<p>I think so, yes</p>



<a name="194685839"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/When%20to%20re-run%20ThinLTO%2C%20for%20PR%20%2371267/near/194685839" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/When.20to.20re-run.20ThinLTO.2C.20for.20PR.20.2371267.html#194685839">(Apr 20 2020 at 14:52)</a>:</h4>
<p>/me realizes that some of the names in the code itself are decidedly subpar</p>



<a name="194689627"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/When%20to%20re-run%20ThinLTO%2C%20for%20PR%20%2371267/near/194689627" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Hanna Kruppe <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/When.20to.20re-run.20ThinLTO.2C.20for.20PR.20.2371267.html#194689627">(Apr 20 2020 at 15:17)</a>:</h4>
<p>From the architecture of ThinLTO, I really wouldn't expect that CGU 1 or 2 can influence CGU 3 at all if CGU 3 doesn't itself read from the summary of 1 or 2. This seems counter to the parallel-except-as-mediated-by-summaries nature of ThinLTO.</p>



<a name="194723283"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/When%20to%20re-run%20ThinLTO%2C%20for%20PR%20%2371267/near/194723283" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/When.20to.20re-run.20ThinLTO.2C.20for.20PR.20.2371267.html#194723283">(Apr 20 2020 at 19:43)</a>:</h4>
<p><span class="user-mention" data-user-id="116083">@pnkfelix</span> are we waiting on <a href="https://github.com/rust-lang/rust/pull/71267" title="https://github.com/rust-lang/rust/pull/71267">https://github.com/rust-lang/rust/pull/71267</a> for beta-&gt;stable bump? I can cherry pick commits from it</p>



<a name="194723352"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/When%20to%20re-run%20ThinLTO%2C%20for%20PR%20%2371267/near/194723352" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/When.20to.20re-run.20ThinLTO.2C.20for.20PR.20.2371267.html#194723352">(Apr 20 2020 at 19:44)</a>:</h4>
<p>Yeah I don't know...</p>



<a name="194723374"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/When%20to%20re-run%20ThinLTO%2C%20for%20PR%20%2371267/near/194723374" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/When.20to.20re-run.20ThinLTO.2C.20for.20PR.20.2371267.html#194723374">(Apr 20 2020 at 19:44)</a>:</h4>
<p>I guess I'm personally comfortable personally beta-accepting it</p>



<a name="194723452"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/When%20to%20re-run%20ThinLTO%2C%20for%20PR%20%2371267/near/194723452" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/When.20to.20re-run.20ThinLTO.2C.20for.20PR.20.2371267.html#194723452">(Apr 20 2020 at 19:45)</a>:</h4>
<p>normally I'd prefer to put it through a round of T-compiler review, but in this particular case, given that its literally just removing code from a prior beta backport (and therefore has ... essentially zero chance of injecting a new regression beyond what was the case before that backport...) ...</p>



<a name="194723473"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/When%20to%20re-run%20ThinLTO%2C%20for%20PR%20%2371267/near/194723473" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/When.20to.20re-run.20ThinLTO.2C.20for.20PR.20.2371267.html#194723473">(Apr 20 2020 at 19:45)</a>:</h4>
<p>lets go for it, I'll mark it insta-beta-accepted based on the research I did on that LLVM blog post.</p>



<a name="194723635"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/When%20to%20re-run%20ThinLTO%2C%20for%20PR%20%2371267/near/194723635" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/When.20to.20re-run.20ThinLTO.2C.20for.20PR.20.2371267.html#194723635">(Apr 20 2020 at 19:47)</a>:</h4>
<p>Okay, will push it up then and approve</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>